-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wallet: fix makeBatch to generate addresses early #825
Conversation
lib/wallet/wallet.js
Outdated
* @returns {Promise<MTX>} | ||
*/ | ||
|
||
async makeOpen(name, acct, mtx) { | ||
async makeOpen(name, acct, mtx, addr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If addr
is provided then acct
has no use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm true. But acct
is mandatory and also matches other make*
methods signatures. Not sure what can be done
0e18f95
to
dee6d2e
Compare
cd94b88
to
5ed8d30
Compare
So, previous code was generating new address for every bid, but because receiveAddress in makeBid does not increment the depth it was using the cleanup phase to repopulate them with different depth/addresses. Also for the BID it's critical for constructing nonce and now we can pass these addrs even before, so we can avoid this issue. Do we really want to pass ADDR to the OPEN though ? I believe it does not use that address for anything and can easily be outside. Only BID has trouble with it. |
5ed8d30
to
c88837f
Compare
|
ba491a0
to
9b6b750
Compare
Bid actions in makeBatch had their addresses overridden after nonce generation, making it impossible to recover the wallet with importnonce. With this change, the address is derived and passed to make* so the correct address is used to generate nonces.
9b6b750
to
c4aeec4
Compare
Bid actions in
makeBatch
had their addresses overridden after nonce generation, making it impossible to recover the wallet with importnonce.With this change, the address is derived and passed to make* so the correct address is used to generate nonces.
The test covers both
sendbid
andsendbatch
.